DEMO 2: Let's see a more complicated example to see how multiple if statements work!

The code under the test line runs only if the test is true. This code must be indented with a yellow block ···· under the test line. Indented code is INSIDE the if statement.

  • Click Run and type your answer in the user input box. Click Continue on the stage to continue.
  • When finished, click Submit and Next to move on.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)